<template>
	<swiper click="banner">
		<swiper-item v-for="(i, index) in banner" @click="bannerlink(i.link)">
			<!-- /static/images/index/bnner.png -->
			<divimg class="img" :src="i.image" mode="aspectFill" errorUrl="/static/images/index/bnner.png"></divimg>
		</swiper-item>
	</swiper>
</template>

<script>
	export default {
		name: 'banner',
		props: {
			banner:{
				type:Array,
				default:()=>[]
			}
		},
		data() {
			return {};
		},
		methods: {
			bannerlink(link) {
				if (link && link != '') {
					window.location.href = link;
				}
			},
		},
	};
</script>

<style lang="scss" scoped>
	.banner {
		width: 100%;
		height: 350rpx;

		.img {
			width: 100%;
			height: 350rpx;
		}
	}
</style>
